<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>检修项管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/devmng/devchkItem/list?deviceMain.id=${devchkItem.deviceMain.id}&deviceMain.deviceName=${devchkItem.deviceMain.deviceName}">检修项列表</a></li>
		<li class="active"><a href="${ctx}/devmng/devchkItem/form?id=${devchkItem.id}&deviceMain.id=${devchkItem.deviceMain.id}&deviceMain.deviceName=${devchkItem.deviceMain.deviceName}">检修项<shiro:hasPermission name="devmng:devchkItem:edit">${not empty devchkItem.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="devmng:devchkItem:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="devchkItem" action="${ctx}/devmng/devchkItem/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>

		<div class="control-group">
			<label class="control-label">设备：</label>
			<div class="controls">
				<sys:treeselect id="deviceMain" name="deviceMain.id" value="${devchkItem.deviceMain.id}" labelName="deviceMain.deviceName" labelValue="${devchkItem.deviceMain.deviceName}"
								title="设备" url="/devmng/deviceMain/treeData" cssClass="required" allowClear="true" notAllowSelectParent="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">检修周期</label>
			<div class="controls">
				<form:select path="checkPeriod" class="input-xlarge required">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('DEVCHK_PERIOD')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">排序值：</label>
			<div class="controls">
				<form:input path="sortNum" htmlEscape="false" maxlength="11" class="input-xlarge required digits"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">检修内容：</label>
			<div class="controls">
				<form:input path="checkContent" htmlEscape="false" maxlength="500" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">检修标准：</label>
			<div class="controls">
				<form:input path="checkStd" htmlEscape="false" maxlength="500" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">检修方法：</label>
			<div class="controls">
				<form:input path="checkMethod" htmlEscape="false" maxlength="500" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">回答项：</label>
			<div class="controls">
				<span>
					<input id="devchkAnswers1" name="devchkAnswers" class="required" type="checkbox" ${hasDevChkAnswer1?'checked':''} value="1">
					<label for="devchkAnswers1">正常/不正常</label>
				</span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label"></label>
			<div class="controls">
				<span>
					<input id="devchkAnswers4" name="devchkAnswers" class="required" type="checkbox" ${hasDevChkAnswer4?'checked':''} value="4">
					<label for="devchkAnswers4">图片</label>
				</span>
			</div>
		</div>

		<div class="control-group" style="display: none;">
			<label class="control-label"></label>
			<div class="controls">
				<span>
					<input id="devchkAnswers3" name="devchkAnswers" class="required" checked type="checkbox" value="3">
					<label for="devchkAnswers3">备注</label>
				</span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label"></label>
			<div class="controls">
				<div>
					<input id="noneMeature" name="meature" class="required" type="radio" <c:if test="${empty devchkItem.meature}">checked</c:if> ${devchkItem.meature == "noneMeature"?'checked':''} value="noneMeature">
					<label for="noneMeature">无测量值</label>
				</div>
				<div>
					<input id="singleMeature" name="meature" class="required" type="radio" ${devchkItem.meature == "singleMeature"?'checked':''} value="singleMeature">
					<label for="singleMeature">单一测量值</label>
				</div>
				<div style="padding-left: 50px;">
					测量值名称&nbsp;&nbsp;&nbsp;&nbsp;：<input type="text" name="singleMeatureContentDesc" value="${devchkItem.singleMeatureContentDesc}"/> &nbsp;&nbsp;
					单位：
					<select id="singleMeatureUnitCode" name="singleMeatureUnitCode">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.singleMeatureUnitCode?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue" type="text" value="${devchkItem.minValue}" />至<input name="maxValue" type="text" value="${devchkItem.maxValue}" />
				</div>
				<div>
					<input id="multiMeature" name="meature" class="required" type="radio" ${devchkItem.meature == "multiMeature"?'checked':''} value="multiMeature">
					<label for="multiMeature">多个测量值</label>
				</div>
				<div style="padding-left: 50px;">
					测量值1名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc1" value="${devchkItem.multiMeatureContentDesc1}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode1" name="multiMeatureUnitCode1">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode1?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue1" type="text" value="${devchkItem.minValue1}" />至<input name="maxValue1" type="text" value="${devchkItem.maxValue1}" />
				</div>
				<div style="padding-left: 50px;">
					测量值2名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc2" value="${devchkItem.multiMeatureContentDesc2}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode2" name="multiMeatureUnitCode2">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode2?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue2" type="text" value="${devchkItem.minValue2}" />至<input name="maxValue2" type="text" value="${devchkItem.maxValue2}" />
				</div>
				<div style="padding-left: 50px;">
					测量值3名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc3" value="${devchkItem.multiMeatureContentDesc3}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode3" name="multiMeatureUnitCode3">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode3?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue3" type="text" value="${devchkItem.minValue3}" />至<input name="maxValue3" type="text" value="${devchkItem.maxValue3}" />
				</div>
				<div style="padding-left: 50px;">
					测量值4名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc4" value="${devchkItem.multiMeatureContentDesc4}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode4" name="multiMeatureUnitCode4">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode4?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue4" type="text" value="${devchkItem.minValue4}" />至<input name="maxValue4" type="text" value="${devchkItem.maxValue4}" />
				</div>
				<div style="padding-left: 50px;">
					测量值5名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc5" value="${devchkItem.multiMeatureContentDesc5}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode5" name="multiMeatureUnitCode5">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode5?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue5" type="text" value="${devchkItem.minValue5}" />至<input name="maxValue5" type="text" value="${devchkItem.maxValue5}" />
				</div>
				<div style="padding-left: 50px;">
					测量值6名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc6" value="${devchkItem.multiMeatureContentDesc6}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode6" name="multiMeatureUnitCode6">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode6?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue6" type="text" value="${devchkItem.minValue6}" />至<input name="maxValue6" type="text" value="${devchkItem.maxValue6}" />
				</div>

				<div style="padding-left: 50px;">
					测量值7名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc7" value="${devchkItem.multiMeatureContentDesc7}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode7" name="multiMeatureUnitCode7">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode7?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue7" type="text" value="${devchkItem.minValue7}" />至<input name="maxValue7" type="text" value="${devchkItem.maxValue7}" />
				</div>

				<div style="padding-left: 50px;">
					测量值8名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc8" value="${devchkItem.multiMeatureContentDesc8}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode8" name="multiMeatureUnitCode8">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode8?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue8" type="text" value="${devchkItem.minValue8}" />至<input name="maxValue8" type="text" value="${devchkItem.maxValue8}" />
				</div>

				<div style="padding-left: 50px;">
					测量值9名称&nbsp;&nbsp;：<input type="text" name="multiMeatureContentDesc9" value="${devchkItem.multiMeatureContentDesc9}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode9" name="multiMeatureUnitCode9">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode9?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue9" type="text" value="${devchkItem.minValue9}" />至<input name="maxValue9" type="text" value="${devchkItem.maxValue9}" />
				</div>

				<div style="padding-left: 50px;">
					测量值10名称：<input type="text" name="multiMeatureContentDesc10" value="${devchkItem.multiMeatureContentDesc10}"/> &nbsp;&nbsp;
					单位：
					<select id="multiMeatureUnitCode10" name="multiMeatureUnitCode10">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('MEATURE_UNIT')}" var="dict">
							<option value="${dict.value}" ${dict.value==devchkItem.multiMeatureUnitCode10?'selected':''}>${dict.label}</option>
						</c:forEach>
					</select>
					&nbsp;&nbsp;测量值范围：<input name="minValue10" type="text" value="${devchkItem.minValue10}" />至<input name="maxValue10" type="text" value="${devchkItem.maxValue10}" />
				</div>
				<%--<form:input path="devchkAnswers" htmlEscape="false" maxlength="11" class="input-xlarge required digits"/>--%>
				<%--<form:checkboxes path="devchkAnswers" items="${allDevchkAnswers}" itemLabel="remarks" itemValue="id"--%>
								 <%--htmlEscape="false" class="required"/>--%>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>


		<div class="form-actions">
			<shiro:hasPermission name="devmng:devchkItem:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>